#include<stdio.h>
typedef struct
{float x;
float y;
int direction;
int nv;
int power;
BITMAP *img_right[3];
BITMAP *img_left[3];
} perso;



typedef struct
{
int x,y;

BITMAP *bon;
 
int n;

}bonus;

typedef struct
{
int x,y,w,h;



}Sprite;



void enregistrer(FILE *F,perso *p,perso *e,perso *e1,BITMAP *Background,BITMAP *backdgroundcol,bonus *b,bonus *b1,bonus *b2,bonus *b3,int somme_bonus,float poz,int test);
void chargement (perso *p,bonus *b,perso *e,bonus *b1);
void initialisation (perso *p,bonus *b, perso *e,perso *e1, bonus *b1,bonus *b2,bonus *b3) ;
void son ( SAMPLE *sound);
void son1 ( SAMPLE *sound);

void gravity(float *y);
void gravity_pirate(float *poz,perso *p,BITMAP * Background);
void jump_pirate(float *poz,int *test ,perso *p,BITMAP * Background);

int bounding_box_collision_ennemie(int sprite1_x, int sprite1_y, int sprite1_w, int sprite1_h, int
sprite2_x, int sprite2_y, int sprite2_w, int sprite2_h);
int bounding_box_collision(int sprite1_x, int sprite1_y, int sprite1_w, int sprite1_h, int
sprite2_x, int sprite2_y, int sprite2_w, int sprite2_h);
void move_pirate(float *poz ,int *test ,perso *p,int *compteur,BITMAP * Background);
int collision_background_left(float poz ,perso p,BITMAP* BackgroundCol);
int collision_background_right(float poz ,perso p,BITMAP* BackgroundCol);
int collision_background_up(float *poz,Sprite sprite,BITMAP* backgroundcol);
int collision_background_down(float *poz,Sprite sprite,BITMAP* backgroundcol);
int get_pixel(BITMAP* Buffer,int x,int y);

